import request from '@/router/axios'

export function fetchDeptTree(query) {
  return request({
    url: '/dept/user-tree',
    method: 'get',
    params: query
  })
}

export function fetchTree(query) {
  return request({
    url: '/org/tree',
    method: 'get',
    params: query
  })
}

export function getObj(id) {
  return request({
    url: '/org/' + id,
    method: 'get'
  })
}

export function addObj(obj) {
  return request({
    url: '/org',
    method: 'post',
    data: obj
  })
}

export function delObj (data) {
  return request({
    url: '/org/delOrg',
    method: 'delete',
    params:data
  })
}